import {
  COMMERCIAL_ACCEPTANCE_LIST
} from '@/pages/supplier/constants/common'
// 商品信息
const PRODUCT_INFORMATION_FIELDS = [
  { prop: 'mainCategoryCode', label: '主营品类代码', required: true, disabled: true },
  { prop: 'mainCategory', label: '主营品类', required: true, type: 'categorySelect' },
]

// 管理信息
const MANAGEMENT_INFORMATION_FIELDS = [
  { prop: 'supplierCode', label: '供应商代码', disabled: true },
  { prop: 'supplierName', label: '供应商名称', required: true, maxlength: 100 },
  { prop: 'supplierType', label: '供应商类型', disabled: true, type: 'select', sysDict: 10130 },
  { prop: 'channelCustomerName', label: '渠道客户名称' },
  { prop: 'expenseInvoice', label: '是否开费用发票', required: true, type: 'select', sysDict: 10040 },
  { prop: 'coordination', label: '是否线上协同', disabled: true, defaultValue: 18914, type: 'select', sysDict: 10040 },
  { prop: 'createUser', label: '创建人', disabled: true },
  { prop: 'createTime', label: '创建日期', disabled: true, type: 'datetime' },
]

// 结算方式
const BILLING_METHOD_FIELDS = [
  { prop: 'commercialAcceptanceTypeArray', label: '商业承兑票据类型', type: 'select', multiple: true, collapseTags: false, options: COMMERCIAL_ACCEPTANCE_LIST },
  { prop: 'creditAcceptanceType', label: '信用票据承兑类型' },
]

// 结算信息
const BILLING_INFORMATION_FIELDS = [
  { prop: 'checkoutTime', label: '结账时间', type: 'select', sysDict: 15 },
  { prop: 'paidType', label: '付款方式', disabled: true, type: 'select', sysDict: 10131 },
  { prop: 'checkoutRange', label: '结账区间', type: 'select', sysDict: 10133 },
  // { prop: 'settlementType', label: '结算方式', type: 'select', sysDict: 16, disabledValues: [40904, 40905, 40906, 40907] },
  // { prop: 'creditScale', label: '信用凭证比例（%）', type: 'number', min: 0, max: 100 },
  // { prop: 'creditTerm', label: '信用凭证期限（月）', type: 'number', min: 0, max: 999 },
  { prop: 'invoiceType', label: '发票类型', type: 'select', sysDict: 521 },
  { prop: 'taxBillRate1', label: '税票率1', type: 'select', sysDict: 10100 },
  { prop: 'taxBillProvideTime', label: '税票提供时间', type: 'select', dict: 111 },
  { prop: 'centralizedSettle', label: '是否集中结账', required: true, type: 'select', dict: 18 },
  { prop: 'centralizedSettlePlace', label: '集中结账地', type: 'select', dict: 224 },
]

// 财务信息
const FINANCIAL_INFORMATION_FIELDS = [
  { prop: 'contractCode', label: '合同编号' },
  { prop: 'reconciliation', label: '是否对账', disabled: true, type: 'select', dict: 18 },
]

// 交付信息
const DELIVERY_INFORMATION_FIELDS = [
  { prop: 'freightPayer', label: '运费承担方', type: 'select', sysDict: 10146 },
  { prop: 'purchaseStatus', label: '进货状态', required: true, type: 'select', dict: 255 },
]

export {
  PRODUCT_INFORMATION_FIELDS,
  MANAGEMENT_INFORMATION_FIELDS,
  BILLING_INFORMATION_FIELDS,
  BILLING_METHOD_FIELDS,
  FINANCIAL_INFORMATION_FIELDS,
  DELIVERY_INFORMATION_FIELDS,
}
